#include <iostream>
#include <string>
#include <vector>
using namespace std;

void PrintRecive(vector<string>& s){
    for(size_t i = 0; i < s.size(); ++i){
        if(s[i].find(" ") != string::npos || s[i].find(",") != string::npos){
            s[i].push_back('"');
            cout << '"' << s[i];
        }
        else 
            cout << s[i];
        if(i < s.size()-1)
            cout << ", ";
    }
    
}
int main()
{
    int n;
    while(cin >> n){
        getchar();   //cin.get();  //接受n后面的换行符，刷新缓冲区
        vector<string> str(n);  // 保存收件人名字
        for(int i = 0; i < n; ++i)
            getline(cin, str[i]);
        PrintRecive(str);
        cout << endl;
    }
    return 0;
}